How to download green bond data in Green Bond Guide?

I am a python beginner but want to download green bond data in Green Bond Guide (GRNBNDG) using python api.

image
I find that the excel version of the data can be downloaded by clicking the excel button on the north east corner in the screenshot (the data attached), but I am struggling with figuring out the right python syntax.

I see 'GRNBNDG' is the name of Green Bond Guide and there is a Green Bond Flag.

1633569571455.png

so I have tried something like below, without luck.

ek.get_data('GRNBNDG',[*],{'TR.GreenBondFlag':'Y'})

Any hints/help would be appreciated!

Tagged:

Best Answer

  • @sando So probably the best way to go about this is to use the greenbond chain rics - which can offer the universe of green bonds, by currency, type etc. You can get these chain rics from this greenbonds guide screen:

    1633609011996.png

    So with any of these chains you can get a list of these RICS.

    df, err = ek.get_data(['0#AUDAGYGRNBND'],['CF_Name'])
    df

    1633609618513.png

    Once you have your list of instruments you can then request whatever fields you require:

    df1, err = ek.get_data(df['Instrument'].astype(str).values.tolist(),['TR.FiMaturityDate'])
    df1

    There is an excellent article on working with chain objects here

    I hope this can help.

Answers

  • Dear @sando ,

    If your goal is to retrieve data on green bonds which includes the field mentioned in Green Bonds Guide (excel file) I would suggest using Search RDP. The following query returns all green bonds with the fields from the excel you are referring to:

    df = rdp.search(

    view = rdp.SearchViews.FixedIncomeInstruments,

    filter = "IsGreenBond eq true",

    select = 'DocumentTitle, RIC, ISIN, AssetTypeDescription, MaturityDate, FaceOutstandingUSD, TrancheAmount, CouponClass, Currency, IssueDate, SeniorityTypeDescription, MaturityCorpModDuration, MaturityCorpYield, Price, SectorDescription',

    top = 10000)

    df

    The screenshot of resulting dataframe is attached.

    Please note that some of the fields (including names) might be different and to get all possible variables available for "FixedIncomeInstruments " searchview you can use the following query:

    df = rdp.get_search_metadata(view = rdp.SearchViews.FixedIncomeInstruments)
    df.to_excel('fixed.xlsx')

    Then you can add the variable to the "select" field of the "rdp.search" code. This actually offers more flexibility than the Green Bond Guide.

    This Article along with examples will be helpful if you want to have better in depth understanding of how RDP search API works.


    Please let me know if you have any further questions

  • see attached the resulting dataframe